package com.spark.common.core.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.spark.common.annotation.query.Query;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 树级基类entity
 *
 * @author LYCHEE
 * @date 2025/2/14 14:53
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class BaseTreeEntity<T> extends BaseEntity {

    /**
     * 父级ID
     */
    @Query
    private String pid;

    /**
     * 是否叶子节点
     * 0 是
     * 1 否
     */
    @Query
    private Object isLeaf;

    /**
     * 子级节点数据
     */
    @TableField(exist = false)
    private List<T> children;
}
